//
// Created on 2024/10/21.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#include "video_source_wrapper.h"
#include "sdk/ohos/create_ohos_peerconnection_factory.h"

namespace ohosrtc {

VideoSourceWrapper::VideoSourceWrapper(rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> video_source)
    : video_source_(video_source) {}

void VideoSourceWrapper::OnFrame(const webrtc::VideoFrame &frame) {
  ohoswebrtc::OHOSVideoTrackSourceAdapter *video_track_source_adapter = webrtc::GetVideoSourceTrackAdapter(video_source_);
  video_track_source_adapter->OnFrameCaptured(frame);
}

}


